/*
 * printf_stdarg.h
 *
 * Created: 21.06.2013 17:29:35
 *  Author: ILYA
 */ 


#ifndef PRINTF-STDARG_H_
#define PRINTF-STDARG_H_

#include <usart.h>
#include "PICO_CELL_01/PICO_CELL_01.h"
/*this is putchar function, but we remained it by putchar_usart, because of conflict with another function (in stdio.h), with same name*/
#define putchar_usart(c) outbyte(c)


static int outbyte(int c);


static void printchar(char **str, int c);

#define PAD_RIGHT 1
#define PAD_ZERO 2

static int prints(char **out, const char *string, int width, int pad);

/* the following should be enough for 32 bit int */
#define PRINT_BUF_LEN 12

static int printi(char **out, int i, int b, int sg, int width, int pad, int letbase);

int fprintf(__FILE *stream, const char *format, ...);
int fprintf(__FILE *stream, const char *format, ...);
//int print(char **out, const char *format, va_list args );

int printk(const char *format, ...);
int printk(const char *format, ...);

int sprintf(char *out, const char *format, ...);
int sprintf(char *out, const char *format, ...);

#endif /* PRINTF-STDARG_H_ */